<!--%import("./filter/insert_menu_item.xml")-->
<!--%import("./filter/delete_menu_item.xml")-->

<!--#include("_header.html")-->

<!--// tree javascript plugin load -->
<!--%load_js_plugin("ui.tree")-->

<h4 class="xeAdmin">{$lang->cmd_admin_menus[$act]}</h4>
<span style="float:right">
    <a href="#" onclick="doReloadTreeMenu('{$menu_info->menu_srl}');return false;" class="button"><span>{$lang->cmd_remake_cache}</span></a>
</span>
<p class="summary">{$lang->about_cafe_act[$act]}</p>

<form method="post" action="./" id="menu_item_form">
    <input type="hidden" name="menu_item_srl" value="" />
</form>

<form method="post" action="./" id="menu_form">
    <input type="hidden" name="menu_srl" value="{$menu_info->menu_srl}" />
    <div id="menu">
        <ul class="simpleTree">
            <li class="root" id='tree_0'><span>{$lang->menu}</span></li>
        </ul>
    </div>
    <br />
</form>

<div id="menuItem" class="layer boxModelController">
    <form id="fo_menu" action="./" method="post" onsubmit="return procFilter(this, insert_menu_item);" class="clear" target="tmp_upload_iframe" enctype="multipart/form-data">
    <input type="hidden" name="module" value="homepage" />
    <input type="hidden" name="act" value="procHompageUpdateMenuItem" />
    <input type="hidden" name="menu_srl" value="{$menu_info->menu_srl}" />
    <input type="hidden" name="parent_srl" value="" />
    <input type="hidden" name="menu_item_srl" value="" />
    <input type="hidden" name="mode" value="" />
    <input type="hidden" name="target" value="" />
    <input type="hidden" name="normal_btn" value="" />
    <input type="hidden" name="hover_btn" value="" />
    <input type="hidden" name="active_btn" value="" />
    <input type="hidden" name="module_id" value="" />

    <h4 class="xeAdmin">{$lang->menu}</h4>
    <button class="xButton" type="button" onclick="closeTreeMenuInfo();return false" ><span>{$lang->cmd_close}</span></button>

    <div class="layerBody">

        <table cellspacing="0" class="rowTable">
        <col width="100" />
        <col width="" />
        <tr>
            <th scope="row"><div>{$lang->module_type}</div></th>
            <td colspan="2">
                <select name="module_type" onchange="changeMenuType(this)">
                    <!--@foreach($homepage_config->allow_service as $k => $v)-->
                    <option value="{$k}" <!--@if($v<1)-->disabled="disabled"<!--@end-->>{$k}</option>
                    <!--@end-->
                    <option value="url">{$lang->url}</option>
                </select>
            </td>
        </tr>
        <tr id="urlForm" style="display:none;">
            <th scope="row"><div>{$lang->url}</div></th>
            <td colspan="2">
                http://<input type="text" name="url" value="" class="inputTypeText fullWidth" />
                <p>{$lang->about_menu_item_url}</p>
            </td>
        </tr>
        <tr>
            <th scope="row"><div>{$lang->menu_name}</div></th>
            <td colspan="2">
                <input type="text" name="menu_name" id="menu_name" value="" class="inputTypeText"/>
                <a href="{getUrl('','module','module','act','dispModuleAdminLangcode','target','menu_name')}" onclick="popopen(this.href);return false;" class="buttonSet buttonSetting"><span>{$lang->cmd_find_langcode}</span></a>
                <p>{$lang->about_langcode}</p>
            </td>
        </tr>
        <tr>
            <th scope="row"><div>{$lang->cmd_option}</div></th>
            <td colspan="2">
                <input type="checkbox" id="menu_open_window" name="menu_open_window" value="Y" />
                <label for="menu_open_window">{$lang->menu_open_window}</label>
                <input type="checkbox" id="menu_expand" name="menu_expand" value="Y" />
                <label for="menu_expand">{$lang->menu_expand}</label>
                <p>{$lang->about_menu_option}</p>
            </td>
        </tr>
        <tr>
            <th scope="row"><div>{$lang->item_group_grant}</div></th>
            <td colspan="2">
                <!--@foreach($group_list as $key=>$val)-->
                <input type="checkbox" name="group_srls" value="{$key}" id="group_{$key}" <!--@if(is_array($item_info->group_srls)&&in_array($key, $item_info->group_srls))-->checked="checked"<!--@end-->/>
                <label for="group_{$key}">{$val->title}</label>
                <!--@end-->
                <p>{$lang->about_group_grant}</p>
            </td>
        </tr>
        <tr>
            <th scope="row" rowspan="4"><div>{$lang->menu_img_btn}</div></th>
            <th scope="row"><div>{$lang->menu_normal_btn}</div></th>
            <td>
                <div id="menu_normal_btn_zone" <!--@if(!$item_info->normal_btn)-->style="display:none;"<!--@end-->>
                    <img src="" alt="" id="menu_normal_btn_img" /><br />
                    <a href="#" onclick="doDeleteButton('menu_normal_btn');return false;" class="button"><span>{$lang->cmd_delete}</span></a>
                </div>
                <input type="file" name="menu_normal_btn" value="" class="inputTypeText" onchange="doHomepageMenuUploadButton(this); return false;"/>
            </td>
        </tr>
        <tr>
            <th scope="row"><div>{$lang->menu_hover_btn}</div></th>
            <td>
                <div id="menu_hover_btn_zone") <!--@if(!$item_info->hover_btn)-->style="display:none;"<!--@end-->>
                    <img src="" alt="" id="menu_hover_btn_img" /><br />
                    <a href="#" onclick="doDeleteButton('menu_hover_btn');return false;" class="button"><span>{$lang->cmd_delete}</span></a>
                </div>
                <input type="file" name="menu_hover_btn" value="" class="inputTypeText" onchange="doHomepageMenuUploadButton(this); return false;"/>
            </td>
        </tr>
        <tr>
            <th scope="row"><div>{$lang->menu_active_btn}</div></th>
            <td>
                <div id="menu_active_btn_zone" <!--@if(!$item_info->active_btn)-->style="display:none;"<!--@end-->>
                    <img src="" alt="" id="menu_active_btn_img" /><br />
                    <a href="#" onclick="doDeleteButton('menu_active_btn');return false;" class="button"><span>{$lang->cmd_delete}</span></a>
                </div>
                <input type="file" name="menu_active_btn" value="" class="inputTypeText" onchange="doHomepageMenuUploadButton(this); return false;"/>
            </td>
        </tr>
        <tr>
            <td colspan="2">{$lang->about_menu_image_button}</td>
        </tr>
        </table>

        <table cellspacing="0" class="rowTable">
        <tr>
            <th scope="row" class="button"><div>
                <span class="button black strong"><input type="submit" value="{$lang->cmd_save}" /></span>
            </div></th>
        </tr>
        </table>
    </div>

    </form>
</div>

<iframe id='tmp_upload_iframe' name='tmp_upload_iframe' style='display:none;width:1px;height:1px;position:absolute;top:-10px;left:-10px'></iframe>

<script type="text/javascript">
var max_menu_depth = 999; //{$menu_max_depth};
var simpleTreeCollection;
var alertImageOnly = "{$lang->alert_image_only}";
var confirmMenuMove = "{$lang->confirm_move}";
var lang_confirm_delete = "{$lang->confirm_delete}";
var xml_url = "{$menu_info->xml_file}";
homepageLoadMenuInfo(xml_url);
homepageMoveMenuItem();

(function($){
$("[name^=menu_name_]").bind("blur",function(e){
	if($("[name=ck_"+$(this).attr("name")+"]:checked").size()>0){
		$("[name^=ck_menu_name_]:checked").each(function(i){
			$("[name="+$(this).attr("name").substring(3)+"]").val(e.target.value);
		});
	}
});
})(jQuery);
</script>

<!--#include("_footer.html")-->
